ROMAnalysis
This page is to be used for analyzing the Half Minute Hero 2 Archive. The goal is to collect enough information to upack the archive and then repack it. This is mostly for fun. Here's what's known about the archive so far. 1. Of course, you need the ISO. 2. Open the ISO with Daemon Tools Here are the files of note: * Raw Images (for the game's gallery mode) are stored in /PSP_GAME/USRDIR/RES/GALLERYTEX * The AT3 music is all stored in /PSP_GAME/USRDIR/RES/BGM * Cinematics (there's not really much) are all stored in /PSP_GAME/USRDIR/RAWRES * All the actual game data is in the JRZ archives /PSP_GAME/USRDIR 3. The JRZ format is as follows: There is a header that goes from 0x00 to 0x2B. I haven't quite deciphered it. Here is a sample: 5F 5F 44 45 46 4C 41 54 45 5F 41 52 43 48 49 56 45 5F 53 5F 30 31 5F 5F (The above is "__DEFLATE_ARCHIVE_S_01__", but I don't know the next unique part) 09 00 00 00 00 00 01 00 64 00 00 00 01 00 00 00 01 00 00 00 After that first header are the file descriptions. They're in the following format, little endian: 2 Bytes unknown 2 Bytes for the number of bytes in the file name 4 bytes unknown 4 bytes unknown 4 bytes for the file size 4 bytes for the extracted file size 4 bytes unknown 4 bytes for the file offset Here is a sample: - PARTY01.BMP - 00 00 0C 00 (Number of Bytes for the Filename) 00 00 00 00 00 00 00 00 92 0A 00 00 (File Size A) 36 04 01 00 (Extracted File Size A) 00 00 00 00 A9 B1 3B 00 (File Offset A, so value is 0x3BB1A9) 50 41 52 54 59 30 31 2E 42 4D 50 00 (File Name + 00) Finally, is the file data, stored according to the file descriptions. 4. Decompressing the JRZ archives: I use QuickBMS by aluigi. The following bms script can be run against any JRZ file: GoTo 0x2C for i = 0 < 1000 get DUMMY short get FILENAMELENGTH short get DUMMY long get DUMMY long get FILESIZE long get DUMMY long get DUMMY long get OFFSET long getdstring NAME FILENAMELENGTH log NAME OFFSET FILESIZE next i 5. Decompress Resulting Files The resulting files seem to be in a zlib compressed stream. I use aluigi's offzip tool to unpack them. Here's the command format I use: offzip -a -m 8 "TO UNPACK" "DESTINATION" 0 Of course, I use script that automates running the command on all unpacked files. 6. Resulting Files: We have a lot of *.BMP files, these are the sprites and such. I think that *.S2MP files are map data. All the text is buried within the *.DAT files. 7. Extracting Text I haven't figured out the text format yet and it's something I'm working on. But if I take the *.DAT files and scrape all the 0x00 and 0xFF bytes, I get all the text. Each snippet of dialogue is preceded by a 0x01. I made a script to automate this. There are English letters in there, so I'm hoping the text substitution is easy. I'm hoping the null characters are just padding so that the filesizes wouldn't even change.